<?php if ($this->_var['fittings']): ?>
<div class="box">
 <div class="box_1">
  <h3><span><?php echo $this->_var['lang']['accessories_releate']; ?></span></h3>
  <div class="boxCenterList clearfix">
    <?php $_from = $this->_var['fittings']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'goods_0_66832300_1355415272');if (count($_from)):
    foreach ($_from AS $this->_var['goods_0_66832300_1355415272']):
?>
    <ul class="clearfix">
      <li class="goodsimg">
      <a href="<?php echo $this->_var['goods_0_66832300_1355415272']['url']; ?>" target="_blank"><img src="<?php echo $this->_var['goods_0_66832300_1355415272']['goods_thumb']; ?>" alt="<?php echo htmlspecialchars($this->_var['goods_0_66832300_1355415272']['name']); ?>" class="B_blue" /></a>
      </li>
      <li>
      <a href="<?php echo $this->_var['goods_0_66832300_1355415272']['url']; ?>" target="_blank" title="<?php echo htmlspecialchars($this->_var['goods_0_66832300_1355415272']['goods_name']); ?>"><?php echo htmlspecialchars($this->_var['goods_0_66832300_1355415272']['short_name']); ?></a><br />
      <?php echo $this->_var['lang']['fittings_price']; ?><font class="f1"><?php echo $this->_var['goods_0_66832300_1355415272']['fittings_price']; ?></font><br />
      <a href="javascript:fittings_to_flow(<?php echo $this->_var['goods_0_66832300_1355415272']['goods_id']; ?>,<?php echo $this->_var['goods_0_66832300_1355415272']['parent_id']; ?>)"><img src="themes/quwan/images/bnt_buy.gif" alt="<?php echo $this->_var['lang']['collect_to_flow']; ?>" /></a>
      </li>
    </ul>
    <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
  </div>
 </div>
</div>
<div class="blank5"></div>

<script type="text/javascript" charset="utf-8">
  function fittings_to_flow(goodsId,parentId)
  {
    var goods        = new Object();
    var spec_arr     = new Array();
    var number       = 1;
    goods.spec     = spec_arr;
    goods.goods_id = goodsId;
    goods.number   = number;
    goods.parent   = parentId;
    Ajax.call('flow.php?step=add_to_cart', 'goods=' + goods.toJSONString(), fittings_to_flow_response, 'POST', 'JSON');
  }
  function fittings_to_flow_response(result)
  {
    if (result.error > 0)
    {
      // 如果需要缺货登记，跳转
      if (result.error == 2)
      {
        if (confirm(result.message))
        {
          location.href = 'user.php?act=add_booking&id=' + result.goods_id;
        }
      }
      else if (result.error == 6)
      {
        openSpeDiv(result.message, result.goods_id, result.parent);
      }
      else
      {
        alert(result.message);
      }
    }
    else
    {
      location.href = 'flow.php';
    }
  }
  </script>


<?php endif; ?>




